<%--
  Created by IntelliJ IDEA.
  User: 122
  Date: 2024/1/7
  Time: 14:32
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="com.ncist.utils.MybatisUtils" %>
<%@ page import="com.ncist.dao.MessagesDao" %>
<%@ page import="org.apache.ibatis.session.SqlSession" %>
<html>
<body>
<%
    request.setCharacterEncoding("UTF-8");
    String name = request.getParameter("name");
    String wechat = request.getParameter("wechat");
    String date = request.getParameter("date");
    String txt = request.getParameter("txt");
%>
<script type="text/javascript" >
    alert("请输入完整信息");
    window.location.href="index";
</script>
<%

    SqlSession sqlSession;
    sqlSession = MybatisUtils.getSqlSession();
    MessagesDao mapper = sqlSession.getMapper(MessagesDao.class);
    mapper.insertMessages(name,wechat,date,txt);
//                System.out.println(messages);
    //关闭sqlSession
    sqlSession.close();
    response.sendRedirect("message");

%>
</body>
</html>
